#ifndef ELIBC_SKIP_LIST_H
#define ELIBC_SKIP_LIST_H

#include "function.h"

typedef struct LinkedListIterator SkipListIterator;
typedef struct SkipList SkipList;

// SkipListIterator {

void * skipListIteratorData(const SkipListIterator * iterator);

SkipListIterator * skipListIteratorPrev(const SkipListIterator * iterator);

SkipListIterator * skipListIteratorNext(const SkipListIterator * iterator);

// }

// SkipList {

SkipList * skipListNew(FunctionLessThan lessThan, FunctionOnErased onErased);

void skipListDelete(SkipList * list);

SkipListIterator * skipListBegin(const SkipList * list);

SkipListIterator * skipListEnd(const SkipList * list);

int skipListIsEmpty(const SkipList * list);

void skipListClear(SkipList * list);

SkipListIterator * skipListInsert(SkipList * list, const void * data);

SkipListIterator * skipListErase(SkipList * list, const void * data);

SkipListIterator * skipListEraseIf(SkipList * list, const void * key, FunctionLessThan lessThanKey, FunctionLessThan keyLessThan);

SkipListIterator * skipListFind(const SkipList * list, const void * data);

SkipListIterator * skipListFindIf(const SkipList * list, const void * key, FunctionLessThan lessThanKey, FunctionLessThan keyLessThan);

void skipListPrint(const SkipList * list);

void skipListPrintSize(const SkipList * list);

// }

// SkipListForInt {

SkipList * skipListForIntNew();

SkipListIterator * skipListForIntInsert(SkipList * list, int data);

SkipListIterator * skipListForIntErase(SkipList * list, int data);

SkipListIterator * skipListForIntFind(const SkipList * list, int data);

// }

// SkipListForUInt {

SkipList * skipListForUIntNew();

SkipListIterator * skipListForUIntInsert(SkipList * list, unsigned int data);

SkipListIterator * skipListForUIntErase(SkipList * list, unsigned int data);

SkipListIterator * skipListForUIntFind(const SkipList * list, unsigned int data);

// }

#endif // ELIBC_SKIP_LIST_H
